]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
MessageTray: don't forward click on sources with notifications
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 26 Mar 2011 14:57:23 +0000 (15:57 +0100)
committerOwen W. Taylor <otaylor@fishsoup.net>
Tue, 29 Mar 2011 03:05:56 +0000 (23:05 -0400)
When a source has an associated tray icon, we would forward all clicks
to the X11 window, meaning that the summary notification could not
be opened. Instead, restore normal event flow for clicks, when the
source has notifications in the queue.

https://bugzilla.gnome.org/show_bug.cgi?id=645753

js/ui/notificationDaemon.js

index c3ae212ac5218e24533c6246801f4365b40c6b76..d2a50d0e3bcbe9188a0c8c950ca2832b8eb929d6 100644 (file)
@@ -465,6 +465,14 @@ Source.prototype = {
         if (event.type() != Clutter.EventType.BUTTON_RELEASE)
             return false;
 
+        // Left clicks are passed through only where there aren't unacknowledged
+        // notifications, so it possible to open them in summary mode; right
+        // clicks are always forwarded, as the right click menu is not useful for
+        // tray icons
+        if (event.get_button() == 1 &&
+            this.notifications.length > 0)
+            return false;
+
         if (Main.overview.visible) {
             // We can't just connect to Main.overview's 'hidden' signal,
             // because it's emitted *before* it calls popModal()...